/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package IoTools;

import org.jfree.data.xy.AbstractXYZDataset;

/**
 *
 * @author Arnaud
 */
class XYZArrayDataset extends AbstractXYZDataset {
      double[][] data;
      int rowCount = 0;
      int columnCount = 0;

      XYZArrayDataset(double[][] data){
         this.data = data;
         rowCount = data.length;
         columnCount = data[0].length;
      }
      public int getSeriesCount(){
         return 1;
      }
      public Comparable getSeriesKey(int series){
         return "serie";
      }
      public int getItemCount(int series){
         return rowCount*columnCount;
      }
    @Override
      public double getXValue(int series,int item){
         return (int)(item/columnCount);
      }
    @Override
      public double getYValue(int series,int item){
         return item % columnCount;
      }
    @Override
      public double getZValue(int series,int item){
         return data[(int)(item/columnCount)][item % columnCount];
      }
      public Number getX(int series,int item){
         return new Double((int)(item/columnCount));
      }
      public Number getY(int series,int item){
         return new Double(item % columnCount);
      }
      public Number getZ(int series,int item){
         return new Double(data[(int)(item/columnCount)][item % columnCount]);
      }
      


}
